package com.lhj.library.infra.basic.service.impl;

import com.lhj.library.infra.basic.entity.Record;
import com.lhj.library.infra.basic.mapper.RecordDao;
import com.lhj.library.infra.basic.service.RecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Record)表服务实现类
 *
 * @author makejava
 * @since 2023-11-28 09:47:40
 */
@Service("recordService")
public class RecordServiceImpl implements RecordService {
    @Resource
    private RecordDao recordDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public Record queryById(Long id) {
        return this.recordDao.queryById(id);
    }


    /**
     * 新增数据
     *
     * @param record 实例对象
     * @return 实例对象
     */
    @Override
    public Integer insert(Record record) {
        return this.recordDao.insert(record);
    }

    /**
     * 修改数据
     *
     * @param record 实例对象
     * @return 实例对象
     */
    @Override
    public Integer update(Record record) {
        return this.recordDao.update(record);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.recordDao.deleteById(id) > 0;
    }

    @Override
    public Record queryByCondition(Record record) {
        return this.recordDao.queryByCondition(record);
    }

    @Override
    public int count(Record record) {
        return this.recordDao.count(record);
    }

    @Override
    public List<Record> selectByPage(Record record, int start, Integer pageSize) {
        return this.recordDao.selectByPage(record,start,pageSize);
    }

    @Override
    public List<Long> queryByList(Record record) {
        return this.recordDao.queryByList(record);
    }
}
